package cn.itcast.bos.service.base.impl;

import javax.swing.text.html.HTMLDocument.HTMLReader.SpecialAction;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.CourierRepository;
import cn.itcast.bos.domain.base.Courier;
import cn.itcast.bos.service.base.CourierService;
@Service
@Transactional
public class CourierServiceImpl implements CourierService{
@Autowired
private CourierRepository courierRepository;
	@Override
	public void save(Courier courier) {
		// TODO Auto-generated method stub
		courierRepository.save(courier);
	}
	@Override
	public Page<Courier> pagequery(Specification<Courier> specialAction, Pageable pageable) {
		// TODO Auto-generated method stub
		return courierRepository.findAll(specialAction,pageable);
	}
	@Override
	public void delBatch(String[] ids) {
		// TODO Auto-generated method stub
		for (String id : ids) {
			int parseInt = Integer.parseInt(id);
			courierRepository.delBatch(parseInt);
		}
		
	}

}
